package what.basic.list;

import java.awt.BorderLayout;

import javax.swing.*;

public class Jlistfromstring {

	Jlistfromstring(){
		JFrame jf=new JFrame("");
		jf.setSize(300,200);
		jf.setVisible(true);
		JPanel jp=new JPanel();
		jf.setContentPane(jp);
		String[] name={"ssdd","oxocc","doxxoxx"};
		JList jl=new JList(name);
		JTextField jt=new JTextField();
		jp.setLayout(new BorderLayout());
		jp.add(jl,"North");
		jp.add(jt,"South");
		while(true){
			jt.setText((String)jl.getSelectedValue());
		}
	}
	public static void main(String[] args) {
		new Jlistfromstring();
	}

}
